
/**
 * Project Name:cats-zcjc
 * File Name:Station.java
 * Package Name:com.catsic.zcjc.entity
 * Date:2017年10月26日下午4:24:18
 * Copyright (c) 2017, oa.catsic.com All Rights Reserved.
 */
 
package com.catsic.zcjc.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.catsic.base.BaseEntity;


/**
 * ClassName: Station
 * Description: 系统实体类
 * date: 2017年10月26日 下午4:24:18
 * author: xietiebing
 */
@Entity
@Table(name="T_SYSTEM")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class System extends BaseEntity implements Serializable{


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * name:系统名称
	 */
	@Column(name="NAME",nullable=false)
	private String name;
	
	/**
	 * code:系统编号
	 */
	@Column(name="CODE",nullable=false)
	private String code;
	
	/**
	 * type:类型，
	 */
	@Column(name="TYPE")
	private Integer type;
	
	/**
	 * station:所属站点
	 */
	@ManyToOne(fetch = FetchType.LAZY,optional = false)
	@JoinColumn(name="STATION_ID",referencedColumnName = "ID")
	private Station station;
	
	/**
	 * status:状态
	 */
	@Column(name="STATUS")
	private Integer status=0;
	
	/**
	 * remark:备注
	 */
	@Column(name="REMARK")
	private String remark;
	
	/**
	 * equips:设备
	 */
	@OneToMany(cascade=CascadeType.REMOVE,fetch = FetchType.LAZY,mappedBy="system") 
    private List<Equip> equips;
	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Station getStation() {
		return station;
	}

	public void setStation(Station station) {
		this.station = station;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public List<Equip> getEquips() {
		return equips;
	}

	public void setEquips(List<Equip> equips) {
		this.equips = equips;
	}

	@Override
	public String toString() {
		return "System [name=" + name + ", code=" + code + ", type=" + type + ", station=" + station + ", status="
				+ status + "]";
	}

	
	
}
